<?php
class Admin_Model_Category extends Zend_Db_Table_Abstract
{
    protected $_table = 'categories';
    
	public function getListCategory($num_vente) 
	{
		$sql = $this->getAdapter()->select()
		->from($this->_table)
		->where('deleted = 0 AND f_ventes =' . $num_vente)
		->order('ordre', 'nom');
	
		return $this->getAdapter()->fetchAll($sql);
	}
	
	public function getCategory($id)
	{
		$sql = $this->getAdapter()->select()
		->from($this->_table)
		->where('p_categories =?', $id);
		return $this->getAdapter()->fetchRow($sql);
	}
}